feat: Introduce separate replica version - #11401
Open
frankdavid wants to merge 23 commits into
Open
Conversation
There used to be a single version: the one under `/opt/ic/share/version.txt`, read by the orchestrator and passed to the replica. During fast GuestOS upgrade, the replica binaries are hot-swapped via an overlay while the node keeps running the old GuestOS. The base GuestOS version and the replica version must be distinguished. - **`PlatformVersion`** (new struct in `ic-types`, next to `ReplicaVersion`) holds both `guestos_version` (the GuestOS the node booted from) and `replica_version` (the running replica binary). `replica_version: ReplicaVersion` in ``ReplicaConfig` is replaced by `platform_version: PlatformVersion`. - **Build**: the GuestOS image now ships a second version artifact, `/opt/ic/share/binary_version.txt` (plus its `-test` variant). During a fast upgrade, the sysext overlay will shadow it with the post-upgrade version, while `version.txt` — now explicitly the GuestOS version — is never shadowed. - **Orchestrator**: reads both files (`--version-file` → binary version, `--guestos-version-file` → GuestOS version) and passes them when starting the replica process. - **Observability**: `/api/v2/status` gains an optional `guestos_version` field alongside `impl_version`. - **Metrics**: `custom-metrics.sh` now also exports a binary_version metric.
|
✅ No security or compliance issues detected. Reviewed everything up to 5e4e48e. Security Overview
Detected Code Changes
|
|
✅ No security or compliance issues detected. Reviewed everything up to 5e4e48e. Security Overview
Detected Code Changes
|
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces separate GuestOS and replica binary version tracking for fast upgrades.
Changes:
- Adds
PlatformVersionand propagates it through replica and consensus. - Exposes GuestOS version through status APIs and metrics.
- Packages separate GuestOS and binary version artifacts.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
rs/types/types/src/replica_version.rs |
Defines PlatformVersion. |
rs/types/types/src/replica_config.rs |
Uses platform version configuration. |
rs/types/types/src/messages/http/tests.rs |
Updates status fixtures. |
rs/types/types/src/messages/http.rs |
Adds GuestOS status field. |
rs/types/types/src/lib.rs |
Exports PlatformVersion. |
rs/types/types_test_utils/src/ids.rs |
Adds platform-version fixture. |
rs/replica/src/setup_ic_stack.rs |
Propagates platform versions. |
rs/replica/src/args.rs |
Adds GuestOS version argument. |
rs/replica/setup_ic_network/src/lib.rs |
Passes platform versions into consensus. |
rs/replica/bin/replica/main.rs |
Constructs runtime platform version. |
rs/replica_tests/src/lib.rs |
Updates replica test setup. |
rs/replay/src/validator.rs |
Updates replay configuration. |
rs/orchestrator/src/upgrade.rs |
Tracks both versions during upgrades. |
rs/orchestrator/src/processes.rs |
Passes both versions to replicas. |
rs/orchestrator/src/orchestrator.rs |
Loads both version files. |
rs/orchestrator/src/args.rs |
Adds GuestOS version-file argument. |
rs/https_outcalls/consensus/src/pool_manager.rs |
Uses binary version for artifacts. |
rs/http_endpoints/public/tests/common/mod.rs |
Updates endpoint test setup. |
rs/http_endpoints/public/src/status.rs |
Reports both versions. |
rs/http_endpoints/public/src/lib.rs |
Propagates platform versions. |
rs/determinism_test/src/setup.rs |
Updates determinism fixture. |
rs/consensus/tests/payload.rs |
Updates payload test configuration. |
rs/consensus/tests/framework/types.rs |
Uses nested replica version. |
rs/consensus/tests/framework/test_runner.rs |
Updates consensus fixtures. |
rs/consensus/src/consensus/validator.rs |
Validates binary versions. |
rs/consensus/src/consensus/share_aggregator.rs |
Updates test configuration. |
rs/consensus/src/consensus/random_tape_maker.rs |
Emits binary version. |
rs/consensus/src/consensus/random_beacon_maker.rs |
Emits binary version. |
rs/consensus/src/consensus/notary.rs |
Uses binary version. |
rs/consensus/src/consensus/malicious_consensus.rs |
Uses binary version. |
rs/consensus/src/consensus/finalizer.rs |
Uses binary version. |
rs/consensus/src/consensus/catchup_package_maker.rs |
Uses binary version. |
rs/consensus/src/consensus/block_maker.rs |
Uses binary version. |
rs/consensus/src/consensus/batch_delivery.rs |
Updates test configuration. |
rs/consensus/mocks/src/lib.rs |
Builds platform-version mocks. |
rs/consensus/dkg/src/payload_validator.rs |
Updates test configuration. |
rs/consensus/dkg/src/lib.rs |
Extracts binary version for DKG. |
rs/consensus/dkg/src/dkg_key_manager.rs |
Updates test configuration. |
rs/boundary_node/ic_boundary/src/http/handlers.rs |
Updates status response construction. |
ic-os/defs.bzl |
Packages binary version artifacts. |
ic-os/components/monitoring/guestos/custom-metrics.sh |
Adds binary-version metric. |
ic-os/components/guestos/ic-replica.service |
Supplies both version files. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Pierugo Pace <pierugo.pace@dfinity.org>
Bownairo
approved these changes
Sep 2, 2026
Co-authored-by: Pierugo Pace <pierugo.pace@dfinity.org>
Co-authored-by: Pierugo Pace <pierugo.pace@dfinity.org>
Co-authored-by: Pierugo Pace <pierugo.pace@dfinity.org>
pierugo-dfinity
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There used to be a single version: the one under
/opt/ic/share/version.txt, read by the orchestrator and passed to the replica. During fast GuestOS upgrade, the replica binaries are hot-swapped via an overlay while the node keeps running the old GuestOS. The base GuestOS version and the replica version must be distinguished.PlatformVersion(new struct inic-types, next toReplicaVersion) holds bothguestos_version(the GuestOS the node booted from) andreplica_version(the running replica binary).replica_version: ReplicaVersioninReplicaConfigis replaced byplatform_version: PlatformVersion./opt/ic/share/binary_version.txt(plus its-testvariant). During a fast upgrade, the sysext overlay will shadow it with the post-upgrade version, whileversion.txt— now explicitly the GuestOS version — is never shadowed.--version-file→ binary version,--guestos-version-file→ GuestOS version) and passes them when starting the replica process./api/v2/statusgains an optionalguestos_versionfield alongsideimpl_version.custom-metrics.shnow also exports a binary_version metric.